package com.zhuoli.service.springboot.mybatis.limitplugin.service.impl;

import com.zhuoli.service.springboot.mybatis.limitplugin.repository.model.User;
import com.zhuoli.service.springboot.mybatis.limitplugin.repository.service.UserRepository;
import com.zhuoli.service.springboot.mybatis.limitplugin.service.UserControllerService;
import lombok.AllArgsConstructor;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: zhuoli
 * @Date: 2018/8/12 12:30
 * @Description:
 */
@Service
@AllArgsConstructor
public class UserControllerServiceImpl implements UserControllerService {
    private UserRepository userRepository;

    @Override
    public List<User> getAllUsers() {
        return userRepository.getAllUsers();
    }

    @Override
    public List<User> getUserByExampleLimit(String userName, String description, Integer pageNum, Integer pageSize) {
        return userRepository.getUserByExampleLimit(userName, description, pageNum, pageSize);
    }

    @Override
    public User getUserById(Long id) {
        return userRepository.getUserById(id);
    }

    @Override
    public int delUserById(Long id) {
        return userRepository.delUserById(id);
    }

    @Override
    public int createUser(User user) {
        return userRepository.createUser(user);
    }

    @Override
    public int updateUser(User user) {
        return userRepository.updateUser(user);
    }
}